package com.jl.slick.util.graphics;
import java.awt.GridLayout;
import java.io.File;

import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.filechooser.FileFilter;
import javax.swing.text.Utilities;


public class FileChoose extends JFrame 
{
	JFileChooser chooser = new JFileChooser();
	ImageFileFilter filter = new ImageFileFilter();
	public FileChoose()
	{
		chooser.setFileFilter(filter);
	    this.setLayout(new GridLayout(1,1));
		this.add(chooser);
	    this.setSize(500, 300);
	    this.setVisible(true);
	}
	
	
}


class ImageFileFilter extends FileFilter
{
  private final String[] okFileExtensions = 
    new String[] {"jpg", "png", "gif"};

  public boolean accept(File file)
  {
    for (String extension : okFileExtensions)
    {
      if (file.getName().toLowerCase().endsWith(extension))
      {
        return true;
      }
    }
    return false;
  }

@Override
public String getDescription() {
	// TODO Auto-generated method stub
	return null;
}
}